package cn.dkk.structure_design.proxy.dynamic_proxy.jdk;

import cn.dkk.structure_design.proxy.pojo.SaleTickets;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author dkk
 * @date 2022/7/10
 * @desc
 */
public class TrainStationInvokeHandler implements InvocationHandler {

    private SaleTickets target;

    public TrainStationInvokeHandler(SaleTickets saleTickets) {
        this.target=saleTickets;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("代理逻辑");
        return method.invoke(target, args);
    }
}
